import {
  createRouter,
  createWebHistory,
  createWebHashHistory
} from "vue-router"; 
import routes from './routes'

// 无需登录即可访问的路由
const initRoutes = [{
    path: "/",
    redirect: "/home",
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue"),
  },

]; 
 
const router = createRouter({
  history: createWebHistory(),
  routes: [
    ...initRoutes,
    ...routes
  ]
});

// 路由守卫

export default router;